import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_project/config/app_bar_view.dart';

import 'gold_details_list_page.dart';

class AccountDetailsPage extends StatefulWidget {
  const AccountDetailsPage({super.key});

  @override
  State<AccountDetailsPage> createState() => _AccountDetailsPageState();
}

class _AccountDetailsPageState extends State<AccountDetailsPage>
    with SingleTickerProviderStateMixin {
  late TabController tabController;
  List<String> tabList = ['金币明细', '提现记录'];

  @override
  Widget build(BuildContext context) {
    return CommonAppWidget.navAppBar(
      title: '账户明细',
      childWidget: Column(
        children: [
          Container(
            color: Colors.white,
            height: 50,
            child: TabBar(
              tabs: const [
                Text('金币明细'),
                Text('提现记录'),
              ],
              controller: tabController,
              indicator: const BoxDecoration(),
              unselectedLabelStyle: const TextStyle(
                fontSize: 14.0,
              ),
              dividerHeight: 0.0,
              // 未选择样式
              labelStyle: const TextStyle(
                fontSize: 16.0,
                fontWeight: FontWeight.w500,
              ),
              // 选择的样式
              //tabAlignment: TabAlignment.center,
            ),
          ),
          const SizedBox(height: 10,),
          Expanded(
            child: TabBarView(controller: tabController, children: const [
              GoldDetailsListPage(),
              GoldDetailsListPage(),
            ]),
          )
        ],
      ),
    );
  }

  @override
  void initState() {
    super.initState();
    tabController = TabController(length: tabList.length, vsync: this);
  }
}
